package com.video.video.service.impl;

import com.video.common.utils.uuid.IdUtils;
import com.video.video.domain.dto.DKefuDto;
import com.video.video.domain.vo.KefuQuery;
import java.util.List;
import com.video.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.video.video.mapper.DKefuMapper;
import com.video.video.domain.DKefu;
import com.video.video.service.IDKefuService;

/**
 * 客服Service业务层处理
 *
 * @author ruoyi
 * @date 2022-10-27
 */
@Service
public class DKefuServiceImpl implements IDKefuService
{
    @Autowired
    private DKefuMapper dKefuMapper;

    @Override
    public List<DKefuDto> selectDKefuDtoHtList(KefuQuery query) {
        return dKefuMapper.selectDKefuDtoHtList(query);
    }

    @Override
    public List<DKefuDto> selectDKefuDtoList(KefuQuery query) {
        return dKefuMapper.selectDKefuDtoList(query);
    }

    /**
     * 查询客服
     *
     * @param id 客服主键
     * @return 客服
     */
    @Override
    public DKefu selectDKefuById(String id)
    {
        return dKefuMapper.selectDKefuById(id);
    }

    /**
     * 查询客服列表
     *
     * @param dKefu 客服
     * @return 客服
     */
    @Override
    public List<DKefu> selectDKefuList(DKefu dKefu)
    {
        return dKefuMapper.selectDKefuList(dKefu);
    }

    /**
     * 新增客服
     *
     * @param dKefu 客服
     * @return 结果
     */
    @Override
    public int insertDKefu(DKefu dKefu)
    {
        dKefu.setId(IdUtils.getId());
        dKefu.setCreateTime(DateUtils.getNowDate());
        return dKefuMapper.insertDKefu(dKefu);
    }

    /**
     * 修改客服
     *
     * @param dKefu 客服
     * @return 结果
     */
    @Override
    public int updateDKefu(DKefu dKefu)
    {
        dKefu.setUpdateTime(DateUtils.getNowDate());
        return dKefuMapper.updateDKefu(dKefu);
    }

    /**
     * 批量删除客服
     *
     * @param ids 需要删除的客服主键
     * @return 结果
     */
    @Override
    public int deleteDKefuByIds(String[] ids)
    {
        return dKefuMapper.deleteDKefuByIds(ids);
    }

    /**
     * 删除客服信息
     *
     * @param id 客服主键
     * @return 结果
     */
    @Override
    public int deleteDKefuById(String id)
    {
        return dKefuMapper.deleteDKefuById(id);
    }
}
